<?php
$treeTable = new BTreeTable('BWInputValue');

//足球天地＋晚上＋7人球场
$condition1 = array(
    'city' => 'chongqing',
    'bookingStatus' => 'available',
    //下面的两个条件非常重要：
    'bookingStartTime' => '<=' . time(),
    'bookingEndTime' => '>=' . time(),
    'startOfTimeSlot' => '>=170000', //下午5点之后
    'startOfTimeSlot' => '<=230000',
    'courtName' => 'cq-tiandi-11',
    'courtType' => 'soccer_court_11',
    //only get item for current space
    'spaceId' => Blyn::app()->getActiveSpace()->getId()
);
//$count1 = $treeTable->getCount($condition1);
$count1 = 15;
//$list1 = $treeTable->getList($condition1);
//$courtDisplayName = $list1->getItem('courtDisplayName')->getValue();
$courtDisplayName = '重庆天地11号足球公园';
//$courtAddress = $list1->getItem('courtAddress')->getValue();
$courtAddress = "重庆化龙桥";
//$cityAlias = $list1->getItem('cityAlias')->getValue();
$cityAlias = '重庆';
//足球天地＋周末＋7人球场
$condition2 = array(
    'city' => 'chongqing',
    'bookingStatus' => 'available',
    //下面的两个条件非常重要：
    'bookingStartTime' => '<=' . time(),
    'bookingEndTime' => '>=' . time(),
    'startDay' => array('6', '7'),
    'courtName' => 'cq-tiandi-11',
    'courtType' => 'soccer_court_11',
    //only get item for current space
    'spaceId' => Blyn::app()->getActiveSpace()->getId()
);
//$count2 = $treeTable->getCount($condition2);
$count2 = 21;
?>
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
        <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
        <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
        <div class="item active">
            <img style="" src="<?php echo Yii::app()->request->baseUrl . '/images/BWeSport/paodao.png' ?>">
            <div class="carousel-caption">
                <p style="color:#8CC685;font-weight:bold">七人制足球场</p>
                <p style="color:#8CC685"><?php echo $cityAlias; ?><span style="color:#B3B1B2"><?php echo $courtAddress ?></span></p>
                <p style="color:#8D8D8D"><span style="color:#EB6307">晚上5点后</span>&nbsp剩余:<span style="font-weight:bold;color:#ED7219;font-size:30px"><?php echo $count1; ?></span></p>
            </div>
        </div>
        <div class="item">
            <img style="" src="<?php echo Yii::app()->request->baseUrl . '/images/BWeSport/paodao.png' ?>">
            <div class="carousel-caption">
                <p style="color:#8CC685;font-weight:bold">七人制足球场</p>
                <p style="color:#8CC685"><?php echo $cityAlias; ?><span style="color:#B3B1B2"><?php echo $courtAddress ?></span></p>
                <p style="color:#8D8D8D"><span style="color:#EB6307">周末</span>&nbsp剩余:<span style="font-weight:bold;color:#ED7219;font-size:30px"><?php echo $count2; ?></span></p>
            </div>
        </div>
    </div>

    <!-- Controls -->
    <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right"></span>
        <span class="sr-only">Next</span>
    </a>
</div>

<!--
<div id="imgGo">
            <ul id="testUl">
                <li>
                    <div class="main">
                        <div class="tu"><img style="width:100%;height:100%;" src="<?php echo Yii::app()->request->baseUrl . '/images/BWeSport/paodao.png' ?>"></div>
                        <div class="wen">
                            <p style="color:#8CC685;font-weight:bold">十一人制足球场</p>
                            <p style="color:#8CC685">浦东新区<span style="color:#B3B1B2">双桥路302号</span></p>
                            <p style="color:#8D8D8D"><span style="color:#EB6307">今日</span>&nbsp 11月12日&nbsp&nbsp&nbsp剩余:<span style="font-weight:bold;color:#ED7219;font-size:30px">20</span></p>
                        </div>
                        <div style="width:100%;height:0;clear:both"></div>
                    </div>
                </li>
                <li>
                    <div class="main">
                        <div class="tu"><img style="width:100%;height:100%;" src="<?php echo Yii::app()->request->baseUrl . '/images/BWeSport/paodao.png' ?>"></div>           
                        <div class="wen">
                            <p style="color:#8CC685;font-weight:bold">十一人制足球场</p>
                            <p style="color:#8CC685">浦东新区<span style="color:#B3B1B2">双桥路302号</span></p>
                            <p style="color:#8D8D8D"><span style="color:#EB6307">今日</span>&nbsp 11月12日&nbsp&nbsp&nbsp剩余:<span style="font-weight:bold;color:#ED7219;font-size:30px">20</span></p>
                        </div>
                        <div style="width:100%;height:0;clear:both"></div>
                    </div>
                </li>
                <li>
                    <div class="main">
                        <div class="tu"><img style="width:100%;height:100%;" src="<?php echo Yii::app()->request->baseUrl . '/images/BWeSport/paodao.png' ?>"></div>
                        <div class="wen">
                            <p style="color:#8CC685;font-weight:bold">十一人制足球场</p>
                            <p style="color:#8CC685">浦东新区<span style="color:#B3B1B2">双桥路302号</span></p>
                            <p style="color:#8D8D8D"><span style="color:#EB6307">今日</span>&nbsp 11月12日&nbsp&nbsp&nbsp剩余:<span style="font-weight:bold;color:#ED7219;font-size:30px">20</span></p>
                        </div>
                        <div style="width:100%;height:0;clear:both"></div>
                    </div>
                </li>
            </ul>
            <div id="imgIndex"></div>
        </div>
-->